package com.we.wecc.aio.api;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 *  ┏┓  ┏┓
 *┏━┛┻━━┛┻━━┓
 *┃         ┃
 *┃    ━    ┃
 *┃ ┳┛   ┗┳ ┃
 *┃         ┃
 *┃    ┻    ┃
 *┃         ┃
 *┗━┓    ┏━━┛
 *  ┃    ┃神兽保佑
 *  ┃    ┃代码无BUG！
 *  ┃    ┗━━━┓
 *  ┃        ┣┓
 *  ┃       ┏┛
 *  ┗┓┓┏━┳┓┏┛
 *   ┃┫┫ ┃┫┫
 *   ┗┻┛ ┗┻┛
 *
 * @author Cheney
 * @Date 2018-10-08
 */
@SpringBootApplication
@EnableTransactionManagement
@EnableCaching
@EnableScheduling
@MapperScan({"com.we.wecc.us.db.mapper","com.we.wecc.bk.db.mapper","com.we.wecc.aw.db.mapper"})
@ComponentScan(value = { "com.we.wecc.*", "com.x" })
public class Application {
	static Logger logger = LoggerFactory.getLogger(Application.class);

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

	@Bean
	public CommonsMultipartResolver multipartResolver() {
		CommonsMultipartResolver res = new CommonsMultipartResolver();
		res.setMaxUploadSize(5242880);// =5 M
		res.setMaxInMemorySize(10240);// =10 K
		return res;
	}
}